package com.yuqiaotech.zcj.forum.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.yuqiaotech.zcj.auth.model.User;


/**
 * 一个帖子。 Topic是一个话题，连同主帖，回帖，一起称为一个话题。
 * 
 * @author YUQIAOTECH
 * 
 */
@Entity
@Table(name="bbs_topic")
public class Topic {

	private Long id;
	private String subject;
	private String text;
	private Date postTime;
	private String addressDownload;
	private String nameDownload;
	private Forum forum;
	private String subbject;
	private User create;
	private int numTopic;





public int getNumTopic() {
		return numTopic;
	}

	public void setNumTopic(int numTopic) {
		this.numTopic = numTopic;
	}

@ManyToOne(fetch=FetchType.LAZY)
   @JoinColumn(name="create_id")
	public User getCreate() {
		return create;
	}

	public void setCreate(User create) {
		this.create = create;
	}

	public String getSubbject() {
		return subbject;
	}

	public void setSubbject(String subbject) {
		this.subbject = subbject;
	}

	@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="forum_id")
	public Forum getForum() {
		return forum;
	}

	public void setForum(Forum forum) {
		this.forum = forum;
	}

	public String getNameDownload() {
		return nameDownload;
	}

	public void setNameDownload(String nameDownload) {
		this.nameDownload = nameDownload;
	}

	public String getAddressDownload() {
		return addressDownload;
	}

	public void setAddressDownload(String addressDownload) {
		this.addressDownload = addressDownload;
	}


	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public Date getPostTime() {
		return postTime;
	}

	public void setPostTime(Date postTime) {
		this.postTime = postTime;
	}

	@Column(name = "topic_txt", length = 10000)
	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

}
